<?php
require_once 'PHPUnit/Framework.php';
require_once '../Templum.php';

class TemplumTest extends PHPUnit_Framework_TestCase
{
	const TEMPLATE_DIR = '../template';
	const CACHE_DIR = '../cache';
	private $_oTemplum = null;


	/**
	 * Initialize.
	 *
	 * @return void
	 */
	public function setUp()
	{
		$this->_oTemplum = new Templum(self::TEMPLATE_DIR, self::CACHE_DIR);
	}


    public function testClearCache()
    {
    	// set path to dir
    	$aPath = self::CACHE_DIR . '/unit_test.html';
    	// create file
    	$oFd = fopen($aPath, 'w');
    	fwrite($oFd, 'Test text');
    	fclose($oFd);
    	// clear all cache in dir
    	$this->_oTemplum->clearCache();
        // check file on disk
        $bExist = file_exists($aPath);
        // set result
        $this->assertFalse($bExist);
    }


    public function testGetTemplate()
    {
        // crete test template
//		$this->_oTemplum->getTemplate('unit_test.html');
        // Add an element to the Array fixture.
//        $fixture[] = 'Element';
        // Assert that the size of the Array fixture is 1.
//        $this->assertEquals(1, 1);
    }
}